Repository navigation
fix(ci): build the Rust fastled CLI from source when binstall fails - #66
Merged
Merged
Conversation
PR #65 added a Python `_find_rust_fastled_cli` helper that locates the Rust binary by walking `target/{release,debug}/`, `$CARGO_HOME/bin`, and PATH (skipping Python venv dirs). On CI the helper now correctly skips the Python entry-point shim — but then returns `None` because the Rust binary is missing entirely: * `cargo binstall fastled-cli` fails (no release published yet). * `cargo test --workspace` (in `./test`) compiles the test binary into `target/<arch>/debug/deps/` but does not always produce the main bin output at `target/<arch>/debug/fastled[.exe]`. * The Build Webpage / deploy job never runs `cargo test` at all. So `Api.project_init` / `download_cpp_devtools_extension` fail with "Could not locate the fastled CLI binary" on every CI runner. Fix: when cargo-binstall does not supply a pre-built copy, fall back to `cargo build --release --bin fastled` inside `./install`. Both the unit-test and deploy jobs go through `./install`, so this covers both broken paths. Uses the local `_cargo` trampoline so the MSVC target is forced on Windows (matching where the existing helper searches). Local: `bash lint` clean, 119 unit tests pass.
This was referenced May 13, 2026
zackees
added a commit
that referenced
this pull request
May 13, 2026
PR #68's deploy job failed with `FileNotFoundError: fastled executable not found` because `build_site.py` does `which("fastled")` and shells out to plain `fastled --init=...`. Editable installs (`uv pip install -e .`) don't extract the maturin `data` dir to the venv's Scripts/, so PATH lookup found nothing. After cargo-build (the binstall fallback added in PR #66), copy the Rust binary into: * `.venv/Scripts/fastled.exe` (Windows) or `.venv/bin/fastled` (Unix) — mimics the wheel-install layout so PATH lookup resolves to the Rust binary for editable installs. * `wheel-data/scripts/fastled[.exe]` — so subsequent `./build-wheel` bundles the same binary into the wheel. Discovery walks the candidate `target/<triple>/release/`, `target/release/`, and `$CARGO_HOME/bin/` paths so both cargo-build and cargo-binstall outputs are handled.
zackees
added a commit
that referenced
this pull request
May 13, 2026
* feat: bundle the Rust fastled CLI binary in the wheel (closes #67) End users who `pip install fastled` will now receive the Rust `fastled` binary directly in their venv's Scripts/bin directory — no Python entry-point shim, no cargo build at install time. Mechanism: maturin's `[tool.maturin] data` config points at a `wheel-data/` directory which it packages as the wheel's `<pkg>-<ver>.data/` tree. Pip extracts `data/scripts/*` to the venv's Scripts/ (Windows) or bin/ (Unix) on install. Verified locally: $ ./build-wheel $ unzip -l target/wheels/fastled-2.0.7-cp310-abi3-win_amd64.whl | grep .data 6303744 fastled-2.0.7.data/scripts/fastled.exe $ uv pip install target/wheels/fastled-*.whl $ which fastled /tmp/test-venv/Scripts/fastled.exe # the Rust binary $ fastled --version fastled 2.0.7 Changes: - `crates/fastled-cli/src/lib.rs` (new) — moved the body of main.rs and renamed `fn main` to `pub fn run`. `crates/fastled-cli/src/main.rs` shrinks to a one-liner calling `fastled_cli::run()`. The crate now exposes both `[lib]` and `[[bin]]`, so the binary's logic can also be called from other consumers in the future. - `pyproject.toml` — adds `[tool.maturin] data = "wheel-data"`; drops `fastled = "fastled.cli:main"` from `[project.scripts]` (the Rust binary takes over that command). `fled` and `fastled-wasm` stay as Python aliases. - `build-wheel` (new) — helper that compiles the bin via the `_cargo` trampoline, stages it under `wheel-data/scripts/`, then runs `maturin build --release`. - `.github/workflows/_build.yml` — adds a pre-step that compiles the bin for the target triple and stages it under `wheel-data/scripts/` before the existing `maturin build` step. Cross-compile path handled. - `src/fastled/_rust_cli.py` — drops the `_looks_like_python_dir` PATH filter; the Python `fastled` shim no longer exists, so plain `shutil.which("fastled")` is sufficient for the wheel-install case. - `.gitignore` — ignore `wheel-data/`. Editable installs (CI unit-test, deploy, local dev) are unchanged: the existing cargo-build fallback in `./install` (PR #66) keeps populating `target/release/fastled` for the workspace-target lookup. A follow-up can switch CI's editable installs to wheel installs if desired, but that's orthogonal to this PR. Local: `bash lint` clean, 119 unit tests pass. * fix(ci): create wheel-data/ before invoking maturin PR #68's `[tool.maturin] data = "wheel-data"` config requires the directory to exist at maturin invocation time. CI jobs (build, unit-test, integration-test, deploy) all run `./install` which does `uv pip install -e .` → maturin pep517 build-wheel; without wheel-data present, maturin errors with `Caused by: No such data directory`. Move the directory creation to the top of `./install`, before any maturin invocation. The cargo-build step later in the same script populates `wheel-data/scripts/` with the Rust binary for downstream `./build-wheel` use; an empty dir is sufficient for the editable-install path that pip drives. * fix(ci): stage Rust fastled binary into the venv after cargo build PR #68's deploy job failed with `FileNotFoundError: fastled executable not found` because `build_site.py` does `which("fastled")` and shells out to plain `fastled --init=...`. Editable installs (`uv pip install -e .`) don't extract the maturin `data` dir to the venv's Scripts/, so PATH lookup found nothing. After cargo-build (the binstall fallback added in PR #66), copy the Rust binary into: * `.venv/Scripts/fastled.exe` (Windows) or `.venv/bin/fastled` (Unix) — mimics the wheel-install layout so PATH lookup resolves to the Rust binary for editable installs. * `wheel-data/scripts/fastled[.exe]` — so subsequent `./build-wheel` bundles the same binary into the wheel. Discovery walks the candidate `target/<triple>/release/`, `target/release/`, and `$CARGO_HOME/bin/` paths so both cargo-build and cargo-binstall outputs are handled.
2 of 3 tasks
zackees
added a commit
that referenced
this pull request
May 13, 2026
Sweeps the non-Python items issue #59 flagged that are still on main after PRs #61, #62, #64, #65, #66, #68 cleaned up the Python side: * `entrypoint.sh` — Docker container entrypoint. Sourced `/emsdk/emsdk_env.sh` (container path) and called `fastled_wasm_compiler.cli_update_from_master` (a module from a separate package that only exists inside the container). * `compiler/run.py` — Docker compile-server entry point. Imports `fastled_wasm_compiler`, a separate package not in this repo. * `compiler/debug.sh` — instructed user to run from `/js` (container working directory). Empty `compiler/` directory removed. * `.dockerignore` — only contained cache exclusions (`**/.mypy_cache/`, `**/.ruff_cache/`) which belong in `.gitignore` if anywhere; no Docker build context this could serve. * `chrome_vscode_bridge_design_task.md` — one-off design draft that opens with "Here's a refined ... file for your repo. Feel free to adjust...". Zero references anywhere else. * `upload_package.sh` — manual PyPI upload helper, superseded by the automated `publish_release.yml` workflow. Zero inbound references. * Empty root-level `fastled/` directory left over from a prior layout. `lint` script updated to stop passing the (now-deleted) `compiler/` path to ruff / black / isort / pyright / the keyboard-interrupt checker. `bash lint` clean. `bash test` — 119 pass. Verified by grep across `*.py`, `*.rs`, `*.toml`, `*.yml`, `*.sh`, `*.md`, `Cargo.toml` (excluding `.venv/` and `.claude/worktrees/`): none of the deleted files are referenced from a live code path or workflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to PR #65, which merged the Python
_find_rust_fastled_clihelper. The helper now correctly avoids the Python entry-point shim — but in CI the lookup returnsNonebecause the Rust binary is missing entirely:cargo binstall fastled-clifails (no published release yet).cargo test --workspace(in./test) compiles the test binary intotarget/<arch>/debug/deps/but does not always produce the main bin output attarget/<arch>/debug/fastled[.exe].deployjob never runscargo testat all.Result:
Api.project_initanddownload_cpp_devtools_extensionfail across every runner withRuntimeError: Could not locate the fastled CLI binary(visible in the current red unit-test + deploy jobs onmain).Fix
When
cargo binstall fastled-clidoes not supply a pre-built copy,./installnow falls back to building the binary from source:"$(dirname "$0")/_cargo" build --release --bin fastled_cargotrampoline so the MSVC target gets forced on Windows (matching the directories_rust_cli.pysearches)../install.cargo binstallsucceeds (release published) — that path still wins.Test plan
bash -n installcleanbash lintcleanbash test— 119 unit tests pass locally with the binary populated intarget/debug/call / unit-testanddeployjobs both turn greenRefs #63, #64, #65
🤖 Generated with Claude Code